class PurchaseEvaluationProject {
  String? id;
  String? templateId;
  String? templateName;
  String? evaluationProject;
  String? deptId;
  String? deptName;
  String? comment;
  String? createUid;
  String? testerUid;
  String? testerName;
  String? createDate;

  PurchaseEvaluationProject(
      {this.id,
      this.templateId,
      this.templateName,
      this.evaluationProject,
      this.deptId,
      this.deptName,
      this.comment,
      this.createUid,
      this.createDate,
      this.testerUid,
      this.testerName});

  PurchaseEvaluationProject copyWith({
    String? id,
    String? templateId,
    String? templateName,
  }) {
    return new PurchaseEvaluationProject(
        id: id ?? this.id,
        templateId: templateId ?? this.templateId,
        templateName: templateName ?? this.templateName,
        testerUid: testerUid ?? this.testerUid,
        testerName: testerName ?? this.testerName);
  }

  @override
  String toString() {
    return '''PurchaseEvaluationProject{
      id: id,
      templateId: templateId,
      templateName: templateName,
      testerUid: testerUid
    }''';
  }

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      (other is PurchaseEvaluationProject &&
          runtimeType == other.runtimeType &&
          id == other.id &&
          templateId == other.templateId &&
          templateName == other.templateName);

  factory PurchaseEvaluationProject.fromMap(Map<String, dynamic> map) {
    return new PurchaseEvaluationProject(
        id: map['id'] != false ? map['id'].toString() as String? : "",
        templateId: map['template_id'][0] != false
            ? map['template_id'][0].toString() as String?
            : "",
        templateName: map['template_id'][1] != false
            ? map['template_id'][1].toString() as String?
            : "",
        evaluationProject: map['evaluation_project'] != false
            ? map['evaluation_project'].toString() as String?
            : "",
        deptId: map['dept_id'][0] != false
            ? map['dept_id'][0].toString() as String?
            : "",
        deptName: map['dept_id'][1] != false
            ? map['dept_id'][1].toString() as String?
            : "",
        comment:
            map['comment'] != false ? map['comment'].toString() as String? : "",
        createUid: map['create_uid'] != false
            ? map['create_uid'][1].toString() as String?
            : "",
        createDate: map['create_date'] != false
            ? map['create_date'].toString() as String?
            : "",
        testerUid: map['tester_id'] != false ? '${(map['tester_id'][0])}' : '',
        testerName: map['tester_id'] != false ? map['tester_id'][1] : '');
  }

  Map<String, dynamic> toMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'templateId': this.templateId,
      'templateName': this.templateName,
      'testerUid': this.templateId
    } as Map<String, dynamic>;
  }

  List toDomainList() {
    List list = [
      if (this.templateId != null && this.templateId != '')
        ['template_id', '=', int.parse(this.templateId!)],
    ] as List;
    // if (list.length == 0) {
    //   list.add(['id', '!=', null]);
    // }
    // ignore: unnecessary_cast
    return list;
  }

  Map<String, dynamic> toOdooMap() {
    // ignore: unnecessary_cast
    return {
      'id': this.id,
      'template_id': this.templateId,
      'evaluation_project': this.evaluationProject,
      'dept_id': this.deptId,
      'comment': this.comment,
      'tester_id': this.testerUid
    } as Map<String, dynamic>;
  }

//</editor-fold>

}
